/* 
 *   Typora Theme - Lapis CV  /  Author - YiNN (BingyanStudio)
 *   https://github.com/BingyanStudio/LapisCV
 */

/* Custom Config */

:root {
    --text-size: 10pt;
    --line-height: 1.8;
    --avatar-width: 29mm;

    --text-color: #353a42;
    --primary-color: #4870ac;
    --link-color: #4c91da;
    --shadow-color: #dae3eac9;
    --border-color: #dae3ea;

    --h1-size: 16pt;
    --h2-size: 12pt;
    --h3-size: 10.5pt;

    --text-font: 'SourceHanSansCN';
    --title-font: 'SourceHanSansCN';
    --link-font: 'JetBrainsMono';
    --code-font: 'JetBrainsMono';
}

@media print {
    @page {
        margin: 12mm 6mm 0 6mm;
    }
}

/* Font Face */

@font-face {
    font-family: "JetBrainsMono";
    src: url('lapis-cv/JetBrainsMono-Regular.ttf');
}

@font-face {
    font-family: "SourceHanSansCN";
    src: url('lapis-cv/SourceHanSansCN-Regular.otf');
}

@font-face {
    font-family: "SourceHanSansCN";
    src: url('lapis-cv/SourceHanSansCN-Bold.otf');
    font-weight: bold;
}

/* Global */

#write {
    max-width: 224mm;
    text-align: justify;
    font-size: var(--text-size);
    line-height: var(--line-height);
    font-family: var(--text-font);
}

@media screen {
    #write {
        box-shadow: 0 0 4mm 0 var(--shadow-color);
        padding-left: 20mm;
        padding-right: 20mm;
        padding-top: 12mm;
    }
}

/* Title */

#write h1,
#write h2 {
    font-family: var(--title-font);
}

#write h1 {
    font-size: var(--h1-size);
    line-height: 1.5;
}

#write h1,
#write blockquote {
    text-align: center;
}

#write h2 {
    color: var(--primary-color);
    font-size: var(--h2-size);
    border-bottom: 1px solid var(--primary-color);
    margin-top: 2.4mm;
    margin-bottom: 2mm;
    line-height: 1;
    padding: 1mm 0;
}

#write h3,
#write h4,
#write h5,
#write h6 {
    font-size: var(--h3-size) - 0.5pt;
}

#write h3 a,
#write h4 a,
#write h5 a,
#write h6 a {
    font-weight: normal;
    font-size: var(--h3-size);
}

#write .md-math-block,
#write .md-rawblock,
#write h1,
#write h3,
#write h4,
#write h5,
#write h6,
#write blockquote,
#write p {
    margin-top: 0;
    margin-bottom: 0;
}

@media print {
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        page-break-after: avoid;
    }
}

/* List */

#write ul {
    list-style-type: '\2022';
    padding-inline-start: 3mm;
    padding-inline-end: 1mm;
}

#write ol {
    padding-inline-start: 5mm;
    padding-inline-end: 1mm;
}

#write ol li {
    padding-left: 0;
}

#write ol,
#write ul {
    margin-block-start: 0;
    margin-block-end: 0;
    margin-inline-start: 0;
    margin-inline-end: 0;
}

#write li {
    padding-left: 1.5mm;
}

ul ::marker {
    font-weight: bolder;
}

ol ::marker {
    font-weight: normal;
}

/* Avatar */

#write img[alt="avatar"] {
    display: block;
    position: absolute;
    z-index: 9999;
    float: right;
    object-fit: cover;
    overflow: hidden;

    width: var(--avatar-width);
    height: var(--avatar-width);
    border-radius: 50%;
    border: 2px solid var(--border-color);
    box-shadow: 0 0 0 3mm var(--bg-color);
}

#write p:has(img[alt="avatar"]) {
    height: 0;
    text-align: center;
}

@media screen {
    #write img[alt="avatar"] {
        top: 1mm;
        right: 0;
    }
}

@media print {
    #write img[alt="avatar"] {
        top: 3mm;
        right: 0;
    }
}

/* Link */

#write a {
    color: var(--link-color);
    font-family: var(--link-font);
    text-decoration: none;
}

/* Code */

#write code {
    background-color: var(--bg-color);
    font-family: var(--code-font);
}

/* Block Quote */

#write blockquote {
    line-height: 1.6;
}

/* Horizontal Line */

#write hr {
    border-top: 2px solid var(--shadow-color);
    margin: 15mm 0 12mm 0;
}

@media print {
    #write hr {
        page-break-after: always;
        margin: 0;
        visibility: hidden;
    }
}